
/*
 *  Copyright (c) 2016. For Intelligent Group.
 *
 */

package com.intelligent.ispc.client.core.validator;

import com.intelligent.ispc.client.utils.binding.AbstractBean;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

/**
 * Created by Lucien.Chen on 2016/9/1.
 */
public class SysGrrDto extends AbstractBean {
    public static final String PROPERTYNAME_SCHEME = "scheme";
    public static final String PROPERTYNAME_SIGMA = "sigma";
    public static final String PROPERTYNAME_FIRSTCHANGE = "firstChange";
    public static final String PROPERTYNAME_PARTS = "parts";
    public static final String PROPERTYNAME_APPRAISERS = "appraisers";
    public static final String PROPERTYNAME_TRAILS = "trails";
    public static final String PROPERTYNAME_EXCELLENT = "excellent";
    public static final String PROPERTYNAME_ADEQUATE = "adequate";
    public static final String PROPERTYNAME_MARGINAL = "marginal";
    public static final String PROPERTYNAME_GROUP1KEY = "group1Key";
    public static final String PROPERTYNAME_GROUP2KEY = "group2Key";
    public static final String PROPERTYNAME_PARTKEY = "partKey";
    public static final String PROPERTYNAME_OPERATORKEY = "operatorKey";
    public static final String PROPERTYNAME_DIGIT = "digit";
    private Long id;

    private String scheme;

    private String sigma;

    @Digits(integer = 9, fraction = 0, message = "Not be Integer")
    @Max(value = 10, message = "Max must be 10")
    @Min(value = 0, message = "Min must be 0")
    private String digit;

    @NotEmpty(message = "Not be empty")
    @Digits(integer = 9, fraction = 0, message = "Not be Integer")
    @Min(value = 0, message = "Can't be negative number")
    private String parts;

    @NotEmpty(message = "Not be empty")
    @Digits(integer = 9, fraction = 0, message = "Not be Integer")
    @Min(value = 0, message = "Can't be negative number")
    private String appraisers;

    @NotEmpty(message = "Not be empty")
    @Digits(integer = 9, fraction = 0, message = "Not be Integer")
    @Min(value = 0, message = "Can't be negative number")
    private String trails;

    @NotEmpty(message = "Not be empty")
    @Digits(integer = 9, fraction = 2, message = "must be 2 decimal")
    @Min(value = 0, message = "Can't be negative number")
    private String excellent;

    @NotEmpty(message = "Not be empty")
    @Digits(integer = 9, fraction = 2, message = "must be 2 decimal")
    @Min(value = 0, message = "Can't be negative number")
    private String adequate;

    @NotEmpty(message = "Not be empty")
    @Digits(integer = 9, fraction = 2, message = "must be 2 decimal")
    @Min(value = 0, message = "Can't be negative number")
    private String marginal;

    @NotEmpty(message = "Not be empty")
    private String group1Key;
    private String group2Key;
    @NotEmpty(message = "Not be empty")
    private String partKey;
    @NotEmpty(message = "Not be empty", groups = Slot.class)
    private String operatorKey;

    private String firstChange; //operator, trial

    public String getDigit() {
        return digit;
    }

    /**
     * fire paroperty change for digit seted
     *
     * @param digit new digit value
     */
    public void setDigit(String digit) {
        firePropertyChange(PROPERTYNAME_DIGIT, this.digit, this.digit = digit);
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getScheme() {
        return scheme;
    }

    /**
     * fire paroperty change for scheme seted
     *
     * @param scheme new scheme value
     */
    public void setScheme(String scheme) {
        firePropertyChange(PROPERTYNAME_SCHEME, this.scheme, this.scheme = scheme);
    }

    public String getParts() {
        return parts;
    }

    /**
     * fire paroperty change for parts seted
     *
     * @param parts new parts value
     */
    public void setParts(String parts) {
        firePropertyChange(PROPERTYNAME_PARTS, this.parts, this.parts = parts);
    }

    public String getAppraisers() {
        return appraisers;
    }

    /**
     * fire paroperty change for appraisers seted
     *
     * @param appraisers new appraisers value
     */
    public void setAppraisers(String appraisers) {
        firePropertyChange(PROPERTYNAME_APPRAISERS, this.appraisers, this.appraisers = appraisers);
    }

    public String getTrails() {
        return trails;
    }

    /**
     * fire paroperty change for trails seted
     *
     * @param trails new trails value
     */
    public void setTrails(String trails) {
        firePropertyChange(PROPERTYNAME_TRAILS, this.trails, this.trails = trails);
    }

    public String getExcellent() {
        return excellent;
    }

    /**
     * fire paroperty change for excellent seted
     *
     * @param excellent new excellent value
     */
    public void setExcellent(String excellent) {
        firePropertyChange(PROPERTYNAME_EXCELLENT, this.excellent, this.excellent = excellent);
    }

    public String getAdequate() {
        return adequate;
    }

    /**
     * fire paroperty change for adequate seted
     *
     * @param adequate new adequate value
     */
    public void setAdequate(String adequate) {
        firePropertyChange(PROPERTYNAME_ADEQUATE, this.adequate, this.adequate = adequate);
    }

    public String getMarginal() {
        return marginal;
    }

    /**
     * fire paroperty change for marginal seted
     *
     * @param marginal new marginal value
     */
    public void setMarginal(String marginal) {
        firePropertyChange(PROPERTYNAME_MARGINAL, this.marginal, this.marginal = marginal);
    }

    public String getSigma() {
        return sigma;
    }

    /**
     * fire paroperty change for sigma seted
     *
     * @param sigma new sigma value
     */
    public void setSigma(String sigma) {
        firePropertyChange(PROPERTYNAME_SIGMA, this.sigma, this.sigma = sigma);
    }

    public String getGroup1Key() {
        return group1Key;
    }

    /**
     * fire paroperty change for group1Key seted
     *
     * @param group1Key new group1Key value
     */
    public void setGroup1Key(String group1Key) {
        firePropertyChange(PROPERTYNAME_GROUP1KEY, this.group1Key, this.group1Key = group1Key);
    }

    public String getGroup2Key() {
        return group2Key;
    }

    /**
     * fire paroperty change for group2Key seted
     *
     * @param group2Key new group2Key value
     */
    public void setGroup2Key(String group2Key) {
        firePropertyChange(PROPERTYNAME_GROUP2KEY, this.group2Key, this.group2Key = group2Key);
    }

    public String getPartKey() {
        return partKey;
    }

    /**
     * fire paroperty change for partKey seted
     *
     * @param partKey new partKey value
     */
    public void setPartKey(String partKey) {
        firePropertyChange(PROPERTYNAME_PARTKEY, this.partKey, this.partKey = partKey);
    }

    public String getOperatorKey() {
        return operatorKey;
    }

    /**
     * fire paroperty change for operatorKey seted
     *
     * @param operatorKey new operatorKey value
     */
    public void setOperatorKey(String operatorKey) {
        firePropertyChange(PROPERTYNAME_OPERATORKEY, this.operatorKey, this.operatorKey = operatorKey);
    }

    public String getFirstChange() {
        return firstChange;
    }

    /**
     * fire paroperty change for firstChange seted
     *
     * @param firstChange new firstChange value
     */
    public void setFirstChange(String firstChange) {
        firePropertyChange(PROPERTYNAME_FIRSTCHANGE, this.firstChange, this.firstChange = firstChange);
    }
}
